<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/template.xhtml"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	>
	<ui:define name="content">
	
		<ui:include src="/includes/menu.xhtml"></ui:include>
	
		<h1><h:outputText value="Můj Profil" /></h1>
		
		<ui:include src="/includes/menuTierTwo.xhtml"></ui:include>
	
		<h2><h:outputText value="Profil" /></h2>
		<h:outputText value="Profil uživatele a jeho administrace:" />
	 	<br />
	 	
	 	<h:form>
		 	<h:panelGrid columns="2">
		 		<h:outputText value="ID:" />	
				<h:outputText value="#{userProfileBean.user.id}" />
				
				<h:outputText value="Nick:" />
				<h:outputText value="#{userProfileBean.user.nick}" /> 
				
				<h:outputText value="Jméno:" /> 
				<h:inputText value="#{userProfileBean.name}" />
				
				<h:outputText value="Příjmení:" /> 
				<h:inputText value="#{userProfileBean.surname}" /> 
				
				<h:outputText value="E-mail:" /> 
				<h:inputText value="#{userProfileBean.mail}" />
				
				<h:outputText value="Město:" /> 
				<h:inputText value="#{userProfileBean.city}" />
				
				<h:outputText value="Profil vytvořen:" /> 
				<h:outputText value="#{userProfileBean.user.date}" /> 
			</h:panelGrid>
			<a4j:commandButton value="Uložit změny" action="#{userProfileBean.saveChanges()}" />
		</h:form> 
		
	 	<h:form>
			<h:panelGrid columns="4">
		 		<h:outputText value="Změnit heslo:" />	
				<h:inputSecret value="#{userProfileBean.password}" />
				<h:outputText value="Nové heslo:" />
				<h:inputSecret value="#{userProfileBean.newPassword}" /> 		
			</h:panelGrid>
			<a4j:commandButton value="Změnit heslo" action="#{userProfileBean.changePass()}" />
		</h:form> 
	</ui:define>
</ui:composition>